package com.smartHire.service.impl;

import com.smartHire.dao.Order_goodsDao;
import com.smartHire.domain.Order_goods;
import com.smartHire.service.Order_goodsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("order_goodsService")
public class Order_goodsServiceImpl implements Order_goodsService {
    @Resource(name="order_goodsDao")
    private Order_goodsDao order_goodsDao;

    @Override
    public int insertOrder_goods(Order_goods order_goods) {

        try {
            int nums = order_goodsDao.insertOrder_goods(order_goods);
            return nums;

        }catch (Exception e)
        {
            e.printStackTrace();
        }

        return 0;
    }

    @Override
    public int updateOrder_goods(Order_goods order_goods) {
        try {
            int nums = order_goodsDao.updateOrder_goods(order_goods);
            return  nums;

        }catch (Exception e)
        {
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public int deleteOrder_goods(Order_goods order_goods) {
        try {
            int nums = order_goodsDao.deleteOrder_goods(order_goods);
            return nums;

        }catch (Exception e)
        {
            e.printStackTrace();
        }

        return 0;
    }

    @Override
    public Order_goods queryOrder_goodsByOrder_Id(Order_goods order_goods) {
        try {
            Order_goods order_goods1 = order_goodsDao.selectOrder_goodsByOrder_Id(order_goods);
            return order_goods1;
        }catch (Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public Order_goods queryOrder_goodsByOG_Id(Order_goods order_goods) {
        try {
            Order_goods order_goods1 = order_goodsDao.selectOrder_goodsByOg_Id(order_goods);
            return order_goods1;
        }catch (Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }
}
